﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.db2
{
	// Token: 0x020001E6 RID: 486
	public class TDb2SetVariableStmt : TCustomDb2Stmt
	{
		// Token: 0x06001060 RID: 4192 RVA: 0x0030CE32 File Offset: 0x0030B032
		public TDb2SetVariableStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstdb2set;
		}

		// Token: 0x06001061 RID: 4193 RVA: 0x0030CE46 File Offset: 0x0030B046
		internal override void buildsql()
		{
		}

		// Token: 0x06001062 RID: 4194 RVA: 0x0030CE48 File Offset: 0x0030B048
		internal override void clear()
		{
		}

		// Token: 0x06001063 RID: 4195 RVA: 0x0030CE4A File Offset: 0x0030B04A
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06001064 RID: 4196 RVA: 0x0030CE51 File Offset: 0x0030B051
		internal override void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x17000305 RID: 773
		// (get) Token: 0x06001065 RID: 4197 RVA: 0x0030CE53 File Offset: 0x0030B053
		// (set) Token: 0x06001066 RID: 4198 RVA: 0x0030CE5B File Offset: 0x0030B05B
		public virtual List<TSetAssignment> Assignments
		{
			get
			{
				return this.assignments;
			}
			set
			{
				this.assignments = value;
			}
		}

		// Token: 0x06001067 RID: 4199 RVA: 0x0030CE64 File Offset: 0x0030B064
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TSetSqlNode tsetSqlNode = (TSetSqlNode)this.rootNode;
			this.assignments = tsetSqlNode.Assignments;
			for (int i = 0; i < this.assignments.Count; i++)
			{
				TExpression expression = this.assignments[i].Expression;
				if (expression.ExpressionType == EExpressionType.simple_comparison_t)
				{
					expression.ExpressionType = EExpressionType.assignment_t;
					expression.doParse(this, ESqlClause.setVariable);
				}
			}
			return 0;
		}

		// Token: 0x17000306 RID: 774
		// (get) Token: 0x06001068 RID: 4200 RVA: 0x0030CEDF File Offset: 0x0030B0DF
		// (set) Token: 0x06001069 RID: 4201 RVA: 0x0030CEE7 File Offset: 0x0030B0E7
		public virtual TExpressionList ExprList
		{
			get
			{
				return this.exprList;
			}
			set
			{
				this.exprList = value;
			}
		}

		// Token: 0x0600106A RID: 4202 RVA: 0x0030CEF0 File Offset: 0x0030B0F0
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x0600106B RID: 4203 RVA: 0x0030CF00 File Offset: 0x0030B100
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			foreach (TSetAssignment tsetAssignment in this.assignments)
			{
				tsetAssignment.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001394 RID: 5012
		private TExpressionList exprList;

		// Token: 0x04001395 RID: 5013
		private List<TSetAssignment> assignments;
	}
}
